<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  
  <script type="module">
    import { reactive, effect, ref, toRef, toRefs } from './reactivity/index.js'

    const obj = reactive({
      foo: 1,
      bar: 2,
    })

    const newObj = {
      ...obj,
    }

    console.log(obj)

    // const newObj = {
    //   foo: {
    //     get value() {
    //       return obj.foo
    //     }
    //   },
    //   bar: {
    //     get value() {
    //       return obj.bar
    //     }
    //   }
    // }

    effect(() => {
      console.log(newObj.foo)
    })

    obj.foo = 2

  </script>
</body>
</html>
